//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<import_dx10.h>
///	@path	~/src/graphics/dx10/
///	@date	2007/10/18
///	@desc	DX10 API dynamic load.

#pragma once

#include "xeres.h"

#include <D3DX10math.h>

// DirectX 9 is also needed
#include <d3d9.h>

// DirectX 10 header files
#include <d3d10.h>
#include <d3dx10.h>
#include <d3d10effect.h>
#include <d3d10shader.h>

namespace xeres {

	namespace dx10
	{
		/// \brief	Explicit initialize Direct3D 10.
		void InitializeDirect3D10( bool enableDebug = false );

		/// \name D3D10 API port.
		//@{

		// Create a Direct3D 10.0 device that represents the display adapter.
		HRESULT WINAPI D3D10CreateDevice(
			IDXGIAdapter *pAdapter,
			D3D10_DRIVER_TYPE DriverType,
			HMODULE Software,
			UINT Flags,
			UINT SDKVersion,
			ID3D10Device **ppDevice );

		// Create a buffer.
		HRESULT WINAPI D3D10CreateBlob(
			SIZE_T NumBytes,
			LPD3D10BLOB *ppBuffer );

		// Create a Direct3D 10.0 device and a swap chain.
		HRESULT WINAPI D3D10CreateDeviceAndSwapChain(
			IDXGIAdapter *pAdapter,
			D3D10_DRIVER_TYPE DriverType,
			HMODULE Software,
			UINT Flags,
			UINT SDKVersion,
			DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
			IDXGISwapChain **ppSwapChain,
			ID3D10Device **ppDevice );

		HRESULT WINAPI CreateDXGIFactory(
			REFIID riid,
			void **ppFactory );

		HRESULT WINAPI D3D10ReflectShader(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10ShaderReflection **ppReflector);

		HRESULT WINAPI D3D10CompileShader(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, 
		    LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs);

		HRESULT WINAPI D3D10DisassembleShader(CONST void *pShader, SIZE_T BytecodeLength, BOOL EnableColorCode, LPCSTR pComments, ID3D10Blob** ppDisassembly);
		LPCSTR WINAPI D3D10GetPixelShaderProfile(ID3D10Device *pDevice);
		LPCSTR WINAPI D3D10GetVertexShaderProfile(ID3D10Device *pDevice);
		LPCSTR WINAPI D3D10GetGeometryShaderProfile(ID3D10Device *pDevice);

		HRESULT WINAPI D3D10PreprocessShader(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, 
			LPD3D10INCLUDE pInclude, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs);

		HRESULT WINAPI D3D10GetInputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob);
		HRESULT WINAPI D3D10GetOutputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob);
		HRESULT WINAPI D3D10GetInputAndOutputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob);

		HRESULT WINAPI D3D10GetShaderDebugInfo(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob** ppDebugInfo);

		HRESULT WINAPI D3D10StateBlockMaskUnion(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult);
		HRESULT WINAPI D3D10StateBlockMaskIntersect(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult);
		HRESULT WINAPI D3D10StateBlockMaskDifference(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult);
		HRESULT WINAPI D3D10StateBlockMaskEnableCapture(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT RangeStart, UINT RangeLength);
		HRESULT WINAPI D3D10StateBlockMaskDisableCapture(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT RangeStart, UINT RangeLength);
		HRESULT WINAPI D3D10StateBlockMaskEnableAll(D3D10_STATE_BLOCK_MASK *pMask);
		HRESULT WINAPI D3D10StateBlockMaskDisableAll(D3D10_STATE_BLOCK_MASK *pMask);
		BOOL    WINAPI D3D10StateBlockMaskGetSetting(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT Entry);

		HRESULT WINAPI D3D10CreateStateBlock(ID3D10Device *pDevice, D3D10_STATE_BLOCK_MASK *pStateBlockMask, ID3D10StateBlock **ppStateBlock);

		HRESULT WINAPI D3D10CompileEffectFromMemory(void *pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, 
			ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, 
			ID3D10Blob **ppCompiledEffect, ID3D10Blob **ppErrors);

		HRESULT WINAPI D3D10CreateEffectFromMemory(void *pData, SIZE_T DataLength, UINT FXFlags, ID3D10Device *pDevice, 
			ID3D10EffectPool *pEffectPool, ID3D10Effect **ppEffect);

		HRESULT WINAPI D3D10CreateEffectPoolFromMemory(void *pData, SIZE_T DataLength, UINT FXFlags, ID3D10Device *pDevice,
			ID3D10EffectPool **ppEffectPool);

		HRESULT WINAPI D3D10DisassembleEffect(ID3D10Effect *pEffect, BOOL EnableColorCode, ID3D10Blob **ppDisassembly);

		//@}

		/// \brief	Explicit initialize Direct3D X 10 with specific version.
		void InitializeDirect3DX10( bool enableDebug = false , uint version = 40 );

		/// \name D3DX 10 API port.
		//@{

		HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *pAdapter,
			D3D10_DRIVER_TYPE DriverType,
			HMODULE Software,
			UINT Flags,
			ID3D10Device **ppDevice);

		HRESULT WINAPI D3DX10CreateDeviceAndSwapChain(IDXGIAdapter *pAdapter,
			D3D10_DRIVER_TYPE DriverType,
			HMODULE Software,
			UINT Flags,
			DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
			IDXGISwapChain **ppSwapChain,    
			ID3D10Device **ppDevice);

		HRESULT WINAPI D3DX10CheckVersion(UINT D3DSdkVersion, UINT D3DX10SdkVersion);

		// Converts an array 32-bit floats to 16-bit floats
		D3DXFLOAT16* WINAPI D3DXFloat32To16Array( D3DXFLOAT16 *pOut, CONST FLOAT *pIn, UINT n );

		// Converts an array 16-bit floats to 32-bit floats
		FLOAT* WINAPI D3DXFloat16To32Array( FLOAT *pOut, CONST D3DXFLOAT16 *pIn, UINT n );

		// Returns the normalized version of a 2D vector.
		D3DXVECTOR2* WINAPI D3DXVec2Normalize( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV );

		// Hermite interpolation between position V1, tangent T1 (when s == 0)
		// and position V2, tangent T2 (when s == 1).
		D3DXVECTOR2* WINAPI D3DXVec2Hermite( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pT1,
			  CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pT2, FLOAT s );

		// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
		D3DXVECTOR2* WINAPI D3DXVec2CatmullRom( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV0, CONST D3DXVECTOR2 *pV1,
			  CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT s );

		// Barycentric coordinates.  V1 + f(V2-V1) + g(V3-V1)
		D3DXVECTOR2* WINAPI D3DXVec2BaryCentric( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2,
			  CONST D3DXVECTOR2 *pV3, FLOAT f, FLOAT g);

		// Transform (x, y, 0, 1) by matrix.
		D3DXVECTOR4* WINAPI D3DXVec2Transform( D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM );

		// Transform (x, y, 0, 1) by matrix, project result back into w=1.
		D3DXVECTOR2* WINAPI D3DXVec2TransformCoord( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM );

		// Transform (x, y, 0, 0) by matrix.
		D3DXVECTOR2* WINAPI D3DXVec2TransformNormal( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM );
		     
		// Transform Array (x, y, 0, 1) by matrix.
		D3DXVECTOR4* WINAPI D3DXVec2TransformArray
			( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n);

		// Transform Array (x, y, 0, 1) by matrix, project result back into w=1.
		D3DXVECTOR2* WINAPI D3DXVec2TransformCoordArray
			( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );

		// Transform Array (x, y, 0, 0) by matrix.
		D3DXVECTOR2* WINAPI D3DXVec2TransformNormalArray
			( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );

		// Returns the normalized version of a 3D vector.
		D3DXVECTOR3* WINAPI D3DXVec3Normalize
			( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV );

		// Hermite interpolation between position V1, tangent T1 (when s == 0)
		// and position V2, tangent T2 (when s == 1).
		D3DXVECTOR3* WINAPI D3DXVec3Hermite
			( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pT1,
			CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pT2, FLOAT s );

		// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
		D3DXVECTOR3* WINAPI D3DXVec3CatmullRom
			( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV0, CONST D3DXVECTOR3 *pV1,
			CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT s );

		// Barycentric coordinates.  V1 + f(V2-V1) + g(V3-V1)
		D3DXVECTOR3* WINAPI D3DXVec3BaryCentric
			( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
			CONST D3DXVECTOR3 *pV3, FLOAT f, FLOAT g);

		// Transform (x, y, z, 1) by matrix.
		D3DXVECTOR4* WINAPI D3DXVec3Transform
			( D3DXVECTOR4 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM );

		// Transform (x, y, z, 1) by matrix, project result back into w=1.
		D3DXVECTOR3* WINAPI D3DXVec3TransformCoord
			( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM );

		// Transform (x, y, z, 0) by matrix.  If you transforming a normal by a 
		// non-affine matrix, the matrix you pass to this function should be the 
		// transpose of the inverse of the matrix you would use to transform a coord.
		D3DXVECTOR3* WINAPI D3DXVec3TransformNormal
			( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM );


		// Transform Array (x, y, z, 1) by matrix. 
		D3DXVECTOR4* WINAPI D3DXVec3TransformArray
			( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );

		// Transform Array (x, y, z, 1) by matrix, project result back into w=1.
		D3DXVECTOR3* WINAPI D3DXVec3TransformCoordArray
			( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );

		// Transform (x, y, z, 0) by matrix.  If you transforming a normal by a 
		// non-affine matrix, the matrix you pass to this function should be the 
		// transpose of the inverse of the matrix you would use to transform a coord.
		D3DXVECTOR3* WINAPI D3DXVec3TransformNormalArray
			( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );

		// Project vector from object space into screen space
		D3DXVECTOR3* WINAPI D3DXVec3Project
			( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3D10_VIEWPORT *pViewport,
			CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld);

		// Project vector from screen space into object space
		D3DXVECTOR3* WINAPI D3DXVec3Unproject
			( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3D10_VIEWPORT *pViewport,
			CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld);

		// Project vector Array from object space into screen space
		D3DXVECTOR3* WINAPI D3DXVec3ProjectArray
			( D3DXVECTOR3 *pOut, UINT OutStride,CONST D3DXVECTOR3 *pV, UINT VStride,CONST D3D10_VIEWPORT *pViewport,
			CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n);

		// Project vector Array from screen space into object space
		D3DXVECTOR3* WINAPI D3DXVec3UnprojectArray
			( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3D10_VIEWPORT *pViewport,
			CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n);

		// Cross-product in 4 dimensions.
		D3DXVECTOR4* WINAPI D3DXVec4Cross( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
			  CONST D3DXVECTOR4 *pV3);

		D3DXVECTOR4* WINAPI D3DXVec4Normalize( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV );

		// Hermite interpolation between position V1, tangent T1 (when s == 0)
		// and position V2, tangent T2 (when s == 1).
		D3DXVECTOR4* WINAPI D3DXVec4Hermite( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pT1,
			  CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pT2, FLOAT s );

		// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
		D3DXVECTOR4* WINAPI D3DXVec4CatmullRom( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV0, CONST D3DXVECTOR4 *pV1,
			  CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT s );

		// Barycentric coordinates.  V1 + f(V2-V1) + g(V3-V1)
		D3DXVECTOR4* WINAPI D3DXVec4BaryCentric( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
			  CONST D3DXVECTOR4 *pV3, FLOAT f, FLOAT g);

		// Transform vector by matrix.
		D3DXVECTOR4* WINAPI D3DXVec4Transform( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM );
		    
		// Transform vector array by matrix.
		D3DXVECTOR4* WINAPI D3DXVec4TransformArray
			( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR4 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n );

		FLOAT WINAPI D3DXMatrixDeterminant( CONST D3DXMATRIX *pM );

		HRESULT WINAPI D3DXMatrixDecompose( D3DXVECTOR3 *pOutScale, D3DXQUATERNION *pOutRotation, 
			D3DXVECTOR3 *pOutTranslation, CONST D3DXMATRIX *pM );

		D3DXMATRIX* WINAPI D3DXMatrixTranspose( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM );

		// Matrix multiplication.  The result represents the transformation M2
		// followed by the transformation M1.  (Out = M1 * M2)
		D3DXMATRIX* WINAPI D3DXMatrixMultiply( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 );

		// Matrix multiplication, followed by a transpose. (Out = T(M1 * M2))
		D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 );

		// Calculate inverse of matrix.  Inversion my fail, in which case NULL will
		// be returned.  The determinant of pM is also returned it pfDeterminant
		// is non-NULL.
		D3DXMATRIX* WINAPI D3DXMatrixInverse
			( D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM );

		// Build a matrix which scales by (sx, sy, sz)
		D3DXMATRIX* WINAPI D3DXMatrixScaling
			( D3DXMATRIX *pOut, FLOAT sx, FLOAT sy, FLOAT sz );

		// Build a matrix which translates by (x, y, z)
		D3DXMATRIX* WINAPI D3DXMatrixTranslation
			( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z );

		// Build a matrix which rotates around the X axis
		D3DXMATRIX* WINAPI D3DXMatrixRotationX
			( D3DXMATRIX *pOut, FLOAT Angle );

		// Build a matrix which rotates around the Y axis
		D3DXMATRIX* WINAPI D3DXMatrixRotationY
			( D3DXMATRIX *pOut, FLOAT Angle );

		// Build a matrix which rotates around the Z axis
		D3DXMATRIX* WINAPI D3DXMatrixRotationZ
			( D3DXMATRIX *pOut, FLOAT Angle );

		// Build a matrix which rotates around an arbitrary axis
		D3DXMATRIX* WINAPI D3DXMatrixRotationAxis
			( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle );

		// Build a matrix from a quaternion
		D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion
			( D3DXMATRIX *pOut, CONST D3DXQUATERNION *pQ);

		// Yaw around the Y axis, a pitch around the X axis,
		// and a roll around the Z axis.
		D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll
			( D3DXMATRIX *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll );

		// Build transformation matrix.  NULL arguments are treated as identity.
		// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
		D3DXMATRIX* WINAPI D3DXMatrixTransformation
			( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pScalingCenter,
			CONST D3DXQUATERNION *pScalingRotation, CONST D3DXVECTOR3 *pScaling,
			CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation,
			CONST D3DXVECTOR3 *pTranslation);

		// Build 2D transformation matrix in XY plane.  NULL arguments are treated as identity.
		// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
		D3DXMATRIX* WINAPI D3DXMatrixTransformation2D
			( D3DXMATRIX *pOut, CONST D3DXVECTOR2* pScalingCenter, 
			FLOAT ScalingRotation, CONST D3DXVECTOR2* pScaling, 
			CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation, 
			CONST D3DXVECTOR2* pTranslation);

		// Build affine transformation matrix.  NULL arguments are treated as identity.
		// Mout = Ms * Mrc-1 * Mr * Mrc * Mt
		D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation
			( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR3 *pRotationCenter,
			CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation);

		// Build 2D affine transformation matrix in XY plane.  NULL arguments are treated as identity.
		// Mout = Ms * Mrc-1 * Mr * Mrc * Mt
		D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D
			( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR2* pRotationCenter, 
			FLOAT Rotation, CONST D3DXVECTOR2* pTranslation);

		// Build a lookat matrix. (right-handed)
		D3DXMATRIX* WINAPI D3DXMatrixLookAtRH
			( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt,
			CONST D3DXVECTOR3 *pUp );

		// Build a lookat matrix. (left-handed)
		D3DXMATRIX* WINAPI D3DXMatrixLookAtLH
			( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt,
			CONST D3DXVECTOR3 *pUp );

		// Build a perspective projection matrix. (right-handed)
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH
			( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );

		// Build a perspective projection matrix. (left-handed)
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH
			( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );

		// Build a perspective projection matrix. (right-handed)
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH
			( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf );

		// Build a perspective projection matrix. (left-handed)
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH
			( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf );

		// Build a perspective projection matrix. (right-handed)
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH
			( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
			FLOAT zf );

		// Build a perspective projection matrix. (left-handed)
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH
			( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
			FLOAT zf );

		// Build an ortho projection matrix. (right-handed)
		D3DXMATRIX* WINAPI D3DXMatrixOrthoRH
			( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );

		// Build an ortho projection matrix. (left-handed)
		D3DXMATRIX* WINAPI D3DXMatrixOrthoLH
			( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf );

		// Build an ortho projection matrix. (right-handed)
		D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH
			( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
			FLOAT zf );

		// Build an ortho projection matrix. (left-handed)
		D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH
			( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
			FLOAT zf );

		// Build a matrix which flattens geometry into a plane, as if casting
		// a shadow from a light.
		D3DXMATRIX* WINAPI D3DXMatrixShadow
			( D3DXMATRIX *pOut, CONST D3DXVECTOR4 *pLight,
			CONST D3DXPLANE *pPlane );

		// Build a matrix which reflects the coordinate system about a plane
		D3DXMATRIX* WINAPI D3DXMatrixReflect
			( D3DXMATRIX *pOut, CONST D3DXPLANE *pPlane );

		// Compute a quaternin's axis and angle of rotation. Expects unit quaternions.
		void WINAPI D3DXQuaternionToAxisAngle
			( CONST D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, FLOAT *pAngle );

		// Build a quaternion from a rotation matrix.
		D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix
			( D3DXQUATERNION *pOut, CONST D3DXMATRIX *pM);

		// Rotation about arbitrary axis.
		D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis
			( D3DXQUATERNION *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle );

		// Yaw around the Y axis, a pitch around the X axis,
		// and a roll around the Z axis.
		D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll
			( D3DXQUATERNION *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll );

		// Quaternion multiplication.  The result represents the rotation Q2
		// followed by the rotation Q1.  (Out = Q2 * Q1)
		D3DXQUATERNION* WINAPI D3DXQuaternionMultiply
			( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
			  CONST D3DXQUATERNION *pQ2 );

		D3DXQUATERNION* WINAPI D3DXQuaternionNormalize
			( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );

		// Conjugate and re-norm
		D3DXQUATERNION* WINAPI D3DXQuaternionInverse
			( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );

		// Expects unit quaternions.
		// if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v)
		D3DXQUATERNION* WINAPI D3DXQuaternionLn
			( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );

		// Expects pure quaternions. (w == 0)  w is ignored in calculation.
		// if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v)
		D3DXQUATERNION* WINAPI D3DXQuaternionExp
			( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );
		      
		// Spherical linear interpolation between Q1 (t == 0) and Q2 (t == 1).
		// Expects unit quaternions.
		D3DXQUATERNION* WINAPI D3DXQuaternionSlerp
			( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
			  CONST D3DXQUATERNION *pQ2, FLOAT t );

		// Spherical quadrangle interpolation.
		// Slerp(Slerp(Q1, C, t), Slerp(A, B, t), 2t(1-t))
		D3DXQUATERNION* WINAPI D3DXQuaternionSquad
			( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
			  CONST D3DXQUATERNION *pA, CONST D3DXQUATERNION *pB,
			  CONST D3DXQUATERNION *pC, FLOAT t );

		// Setup control points for spherical quadrangle interpolation
		// from Q1 to Q2.  The control points are chosen in such a way 
		// to ensure the continuity of tangents with adjacent segments.
		void WINAPI D3DXQuaternionSquadSetup
			( D3DXQUATERNION *pAOut, D3DXQUATERNION *pBOut, D3DXQUATERNION *pCOut,
			  CONST D3DXQUATERNION *pQ0, CONST D3DXQUATERNION *pQ1, 
			  CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3 );

		// Barycentric interpolation.
		// Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g))
		D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric
			( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
			  CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3,
			  FLOAT f, FLOAT g );

		// Normalize plane (so that |a,b,c| == 1)
		D3DXPLANE* WINAPI D3DXPlaneNormalize
			( D3DXPLANE *pOut, CONST D3DXPLANE *pP);

		// Find the intersection between a plane and a line.  If the line is
		// parallel to the plane, NULL is returned.
		D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine
			( D3DXVECTOR3 *pOut, CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV1,
			CONST D3DXVECTOR3 *pV2);

		// Construct a plane from a point and a normal
		D3DXPLANE* WINAPI D3DXPlaneFromPointNormal
			( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pPoint, CONST D3DXVECTOR3 *pNormal);

		// Construct a plane from 3 points
		D3DXPLANE* WINAPI D3DXPlaneFromPoints
			( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
			CONST D3DXVECTOR3 *pV3);

		// Transform a plane by a matrix.  The vector (a,b,c) must be normal.
		// M should be the inverse transpose of the transformation desired.
		D3DXPLANE* WINAPI D3DXPlaneTransform
			( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM );

		// Transform an array of planes by a matrix.  The vectors (a,b,c) must be normal.
		// M should be the inverse transpose of the transformation desired.
		D3DXPLANE* WINAPI D3DXPlaneTransformArray
			( D3DXPLANE *pOut, UINT OutStride, CONST D3DXPLANE *pP, UINT PStride, CONST D3DXMATRIX *pM, UINT n );

		// Interpolate r,g,b between desaturated color and color.
		// DesaturatedColor + s(Color - DesaturatedColor)
		D3DXCOLOR* WINAPI D3DXColorAdjustSaturation
			(D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s);

		// Interpolate r,g,b between 50% grey and color.  Grey + s(Color - Grey)
		D3DXCOLOR* WINAPI D3DXColorAdjustContrast
			(D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT c);

		// Calculate Fresnel term given the cosine of theta (likely obtained by
		// taking the dot of two normals), and the refraction index of the material.
		FLOAT WINAPI D3DXFresnelTerm(FLOAT CosTheta, FLOAT RefractionIndex);   

		HRESULT WINAPI 
			D3DXCreateMatrixStack( 
			UINT                Flags, 
			LPD3DXMATRIXSTACK*  ppStack);

		FLOAT* WINAPI D3DXSHEvalDirection(  FLOAT *pOut, UINT Order, CONST D3DXVECTOR3 *pDir );
		FLOAT* WINAPI D3DXSHRotate( FLOAT *pOut, UINT Order, CONST D3DXMATRIX *pMatrix, CONST FLOAT *pIn );
		FLOAT* WINAPI D3DXSHRotateZ( FLOAT *pOut, UINT Order, FLOAT Angle, CONST FLOAT *pIn );
		FLOAT* WINAPI D3DXSHAdd( FLOAT *pOut, UINT Order, CONST FLOAT *pA, CONST FLOAT *pB );
		FLOAT* WINAPI D3DXSHScale( FLOAT *pOut, UINT Order, CONST FLOAT *pIn, CONST FLOAT Scale );
		FLOAT WINAPI D3DXSHDot( UINT Order, CONST FLOAT *pA, CONST FLOAT *pB );
		FLOAT* WINAPI D3DXSHMultiply2(FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG);
		FLOAT* WINAPI D3DXSHMultiply3(FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG);
		FLOAT* WINAPI D3DXSHMultiply4(FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG);
		FLOAT* WINAPI D3DXSHMultiply5(FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG);
		FLOAT* WINAPI D3DXSHMultiply6(FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG);

		HRESULT WINAPI D3DXSHEvalDirectionalLight
			( UINT Order, CONST D3DXVECTOR3 *pDir, 
			FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
			FLOAT *pROut, 
			FLOAT *pGOut, 
			FLOAT *pBOut );

		HRESULT WINAPI D3DXSHEvalSphericalLight
			( UINT Order, CONST D3DXVECTOR3 *pPos, FLOAT Radius,
			FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
			FLOAT *pROut, 
			FLOAT *pGOut, 
			FLOAT *pBOut );

		HRESULT WINAPI D3DXSHEvalConeLight
			( UINT Order, CONST D3DXVECTOR3 *pDir, FLOAT Radius,
			FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
			FLOAT *pROut, 
			FLOAT *pGOut, 
			FLOAT *pBOut );

		HRESULT WINAPI D3DXSHEvalHemisphereLight
			( UINT Order, CONST D3DXVECTOR3 *pDir, D3DXCOLOR Top, D3DXCOLOR Bottom,
			FLOAT *pROut, 
			FLOAT *pGOut, 
			FLOAT *pBOut );

		// Math intersection functions

		BOOL WINAPI D3DXIntersectTri(
			CONST D3DXVECTOR3 *p0,           // Triangle vertex 0 position
			CONST D3DXVECTOR3 *p1,           // Triangle vertex 1 position
			CONST D3DXVECTOR3 *p2,           // Triangle vertex 2 position
			CONST D3DXVECTOR3 *pRayPos,      // Ray origin
			CONST D3DXVECTOR3 *pRayDir,      // Ray direction
			FLOAT *pU,                         // Barycentric Hit Coordinates
			FLOAT *pV,                         // Barycentric Hit Coordinates
			FLOAT *pDist);                     // Ray-Intersection Parameter Distance

		BOOL WINAPI	D3DXSphereBoundProbe(
			CONST D3DXVECTOR3 *pCenter,
			FLOAT Radius,
			CONST D3DXVECTOR3 *pRayPosition,
			CONST D3DXVECTOR3 *pRayDirection);

		BOOL WINAPI D3DXBoxBoundProbe(
			CONST D3DXVECTOR3 *pMin, 
			CONST D3DXVECTOR3 *pMax,
			CONST D3DXVECTOR3 *pRayPosition,
			CONST D3DXVECTOR3 *pRayDirection);

		HRESULT WINAPI D3DXComputeBoundingSphere(
			CONST D3DXVECTOR3 *pFirstPosition,	// pointer to first position
			DWORD NumVertices, 
			DWORD dwStride,							// count in bytes to subsequent position vectors
			D3DXVECTOR3 *pCenter, 
			FLOAT *pRadius);

		HRESULT WINAPI D3DXComputeBoundingBox(
			CONST D3DXVECTOR3 *pFirstPosition,	// pointer to first position
			DWORD NumVertices, 
			DWORD dwStride,							// count in bytes to subsequent position vectors
			D3DXVECTOR3 *pMin, 
			D3DXVECTOR3 *pMax);

		D3DX_CPU_OPTIMIZATION WINAPI D3DXCpuOptimizations(BOOL Enable);

		HRESULT WINAPI D3DX10CreateSprite( 
				ID3D10Device*         pDevice, 
				UINT                  cDeviceBufferSize,
				LPD3DX10SPRITE*       ppSprite);

		HRESULT WINAPI D3DX10CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX10ThreadPump **ppThreadPump);

		HRESULT WINAPI D3DX10CreateFont(
				ID3D10Device*           pDevice,  
				INT                     Height,
				UINT                    Width,
				UINT                    Weight,
				UINT                    MipLevels,
				BOOL                    Italic,
				UINT                    CharSet,
				UINT                    OutputPrecision,
				UINT                    Quality,
				UINT                    PitchAndFamily,
				LPCWSTR                 pFaceName,
				LPD3DX10FONT*           ppFont);

		HRESULT WINAPI D3DX10CreateFontIndirect( 
			ID3D10Device*             pDevice,  
			CONST D3DX10_FONT_DESCW*   pDesc, 
			LPD3DX10FONT*             ppFont);

		HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device *pDevice);

		HRESULT WINAPI D3DX10GetImageInfoFromFile(
			LPCWSTR                   pSrcFile,
			ID3DX10ThreadPump*        pPump,
			D3DX10_IMAGE_INFO*        pSrcInfo,
			HRESULT*                  pHResult);

		HRESULT WINAPI D3DX10GetImageInfoFromMemory(
			LPCVOID                   pSrcData,
			SIZE_T                    SrcDataSize,
			ID3DX10ThreadPump*        pPump,
			D3DX10_IMAGE_INFO*        pSrcInfo,
			HRESULT*                  pHResult);

		HRESULT WINAPI D3DX10CreateShaderResourceViewFromFile(
			ID3D10Device*               pDevice,
			LPCWSTR                     pSrcFile,
			D3DX10_IMAGE_LOAD_INFO      *pLoadInfo,
			ID3DX10ThreadPump*          pPump,
			ID3D10ShaderResourceView**  ppShaderResourceView,
			HRESULT*                    pHResult);

		HRESULT WINAPI
			D3DX10CreateShaderResourceViewFromMemory(
			ID3D10Device*              pDevice,
			LPCVOID                    pSrcData,
			SIZE_T                     SrcDataSize,
			D3DX10_IMAGE_LOAD_INFO*    pLoadInfo,
			ID3DX10ThreadPump*         pPump,        
			ID3D10ShaderResourceView** ppShaderResourceView,
			HRESULT*                   pHResult);

		HRESULT WINAPI
			D3DX10CreateTextureFromFile(
			ID3D10Device*               pDevice,
			LPCWSTR                     pSrcFile,
			D3DX10_IMAGE_LOAD_INFO      *pLoadInfo,
			ID3DX10ThreadPump*          pPump,
			ID3D10Resource**            ppTexture,
			HRESULT*                    pHResult);

		HRESULT WINAPI
			D3DX10CreateTextureFromMemory(
			ID3D10Device*             pDevice,
			LPCVOID                   pSrcData,
			SIZE_T                    SrcDataSize,
			D3DX10_IMAGE_LOAD_INFO*   pLoadInfo,    
			ID3DX10ThreadPump*        pPump,    
			ID3D10Resource**          ppTexture,
			HRESULT*                  pHResult);

		HRESULT WINAPI
			D3DX10LoadTextureFromTexture(
			ID3D10Resource            *pSrcTexture,
			D3DX10_TEXTURE_LOAD_INFO  *pLoadInfo,
			ID3D10Resource            *pDstTexture);

		HRESULT WINAPI
			D3DX10FilterTexture(
			ID3D10Resource            *pTexture,
			UINT                      SrcLevel,
			UINT                      MipFilter);

		HRESULT WINAPI
			D3DX10SaveTextureToFile(
			ID3D10Resource            *pSrcTexture,
			D3DX10_IMAGE_FILE_FORMAT    DestFormat,
			LPCWSTR                   pDestFile);

		HRESULT WINAPI
			D3DX10SaveTextureToMemory(
			ID3D10Resource*            pSrcTexture,
			D3DX10_IMAGE_FILE_FORMAT   DestFormat,
			LPD3D10BLOB*               ppDestBuf,
			UINT                       Flags);

		HRESULT WINAPI
			D3DX10ComputeNormalMap(
			ID3D10Texture2D		     *pSrcTexture,
			UINT                      Flags,
			UINT                      Channel,
			FLOAT                     Amplitude,
			ID3D10Texture2D		     *pDestTexture);

		HRESULT WINAPI
			D3DX10SHProjectCubeMap(
			UINT                 Order,
			ID3D10Texture2D      *pCubeMap,
			FLOAT                *pROut,
			FLOAT                *pGOut,
			FLOAT                *pBOut);

		HRESULT WINAPI D3DX10CompileFromFile(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
			LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);

		HRESULT WINAPI D3DX10CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, 
			LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);

		HRESULT WINAPI D3DX10CreateEffectFromFile(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines, 
			ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, 
			ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);

		HRESULT WINAPI D3DX10CreateEffectFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, 
			ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, 
			ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);

		HRESULT WINAPI D3DX10CreateEffectPoolFromFile(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines, 
			ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump, 
			ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);

		HRESULT WINAPI D3DX10CreateEffectPoolFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, 
			ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
			ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);

		HRESULT WINAPI D3DX10PreprocessShaderFromFile(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, 
			LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);

		HRESULT WINAPI D3DX10PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, 
			LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);

		HRESULT WINAPI D3DX10CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, 
			LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2,
			ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);

		HRESULT WINAPI D3DX10CreateAsyncEffectCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, 
			LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice,
			ID3D10EffectPool *pPool, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);

		HRESULT WINAPI D3DX10CreateAsyncEffectPoolCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, 
			LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice,
			ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);

		HRESULT WINAPI D3DX10CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, 
			ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);

		HRESULT WINAPI D3DX10CreateAsyncFileLoader(LPCWSTR pFileName, ID3DX10DataLoader **ppDataLoader);

		HRESULT WINAPI D3DX10CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX10DataLoader **ppDataLoader);

		HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor);
		HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor(D3DX10_IMAGE_INFO *pImageInfo, ID3DX10DataProcessor **ppDataProcessor);
		HRESULT WINAPI D3DX10CreateAsyncShaderResourceViewProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor);

		//@}
	} // namespace dx10

} // namespace xeres
